package pers.qianyu.diytomcat.util;

import cn.hutool.core.map.*;
import cn.hutool.log.*;
import cn.hutool.system.*;

import java.util.*;

/**
 * @author mizzle rain
 * @date 2021-01-07 14:23
 */
public class LogUtils {
    public static void logJvm(Log log) {
        HashMap<Object, Object> infos = MapUtil.of(new String[][]{
                {"Server version", "diytomcat/1.0.0"},
                {"Server build", "2021年1月7日14:25:55"},
                {"Server number", "1.0.0"},
                {"OS name", SystemUtil.get(SystemUtil.OS_NAME)},
                {"OS version", SystemUtil.get(SystemUtil.OS_VERSION)},
                {"Architecture", SystemUtil.get(SystemUtil.OS_ARCH)},
                {"Java Home", SystemUtil.get(SystemUtil.HOME)},
                {"Jvm Version", SystemUtil.get(SystemUtil.VM_VERSION)},
                {"Jvm Vendor", SystemUtil.get(SystemUtil.VM_SPECIFICATION_VENDOR)},
        });
        infos.forEach((k, v) -> log.info("{}\t\t{}", k, v));
    }
}
